package com.fyy.sentinel.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author fyy
 * @Description
 * @Date 2021/7/15 15:36
 */
public class ZookeeperController {

    @SentinelResource(value = "TestZK", blockHandler = "exHandler")
    @RequestMapping("/testZK")
    public String hello() {
        return "hello,Sentinel";
    }

    public String exHandler(BlockException e) {
        System.out.println(e.getMessage());
        return "系统繁忙！";
    }

}
